<?php
class PointRedeem extends CWidget
{
	public $postParams=array();
	public $config=array();
	
	public function run()
  	{?>
  	<style type="text/css">
.scroll-pane
{
	width: 100%;
	height: 240px;
	overflow: auto;
}
.container
{
	width: 620px;
	background:#fff;
	padding: 0;
	margin:0;
}
.jspVerticalBar{ width:10px; background:none;}
.jspTrack{ background-color:#ddd; background:url(<?php echo ApplicationConfig::app()->params['theme']['imageUrl']?>scrollP240.png) no-repeat; height:402px;width:10px;}
.jspDrag{width:10px; position:relative; background-color:#999;}
.jspDragTop{ background:url(<?php echo ApplicationConfig::app()->params['theme']['imageUrl']?>dragtop.png) center top no-repeat;width:10px; position:absolute; top:0; height:4px;}
.jspDragBottom{ background:url(<?php echo ApplicationConfig::app()->params['theme']['imageUrl']?>dragbottom.png) center bottom no-repeat;width:10px; height:4px; position:absolute; bottom:0;}
</style>



<div class="container">
	<div>
		<h2 class="mod_title helv_black" style="color:#333;">Earn<span class="helv_neue_thin">&amp;</span>Redeem</h2>  
	</div>
	
		<div class="scroll-pane mt10">
		<div>
	        <?php $offers = Offer::getList("LATEST-OFFERS", array());
       		if (!empty($offers)){
       			$count = 0;
       			foreach ($offers as $offer){
       				$brand = Vendor::model()->getModel("VENDOR-ID",array('vendorID'=>$offer->vendorID));
			 if($count%2==0)
       				{?>
       	<div>
       	<?php } ?>		
			<div class="offer_block1 fl"> 
				<div class="offer_list1 pb15">
					<div class="y_ball fl" style="color: black"><img src="<?php echo ApplicationConfig::getImageUrl('VENDOR-IMAGES-THUMB', array('file_name'=>$brand->vendor_logo_thumb));?>" style="height: 70px;width: 70px;margin-left: -10px;margin-top: -20px;"/><div class="b_name"><?php  $brand->vendor_name." ".$offer->offer_title;?></div><div class="cl"></div><div class="helv_world fnt10"></div></div>
					<div class="fl ml10 offer_info1">
						<div class="fl" style=" line-height:20px;">
							<!--<span class="helv_neue_thin price_unit">Rs</span>--> <span class="helv_black price_amount"><?php echo $offer->offer_value_percentage;?>%</span>
							<div class="cl"></div>
							<span class="helv_light fnt11">DISCOUNT</span>
						</div>
					<div class="fr">
					<a class="add" href="#"></a>
					<div class="cl pt10"></div>
						<div class="fr">
						<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script>
					<a class="facebook" href="http://www.facebook.com/share.php?u=<?php echo Yii::app()->request->requestUri;?>" onclick="return fbs_click()" target="_blank"></a>
					<a  class="twitter" href="http://twitter.com/home?status= Currentlyreading <?php echo Yii::app()->getBaseUrl(true)."".Yii::app()->request->requestUri; ?>" title="Click to share this post on Twitter"  target="_blank"></a>
					<a class='email' href='mailto:type%20email%20address%20here?subject=I%20wanted%20to%20share%20this%20post%20with%20you%20from%20YouthConnect&body=<?php echo "YouthConnect ".Yii::app()->getBaseUrl(true)."".Yii::app()->request->requestUri; ?>' title='YouthConnect Email to a friend/colleague' ></a>
					</div>
						</div>
						<div class="cl"></div>
						<div style="line-height:12px;" class="helv_light"><a class="gr" href="#">View Details</a> <!--<span class="gr">| </span> -->
						<!--<span class="re"><strong>Valid</strong> :25, March 2012</span>--> 
						</div>
					</div>
					<div class="cl"></div>
			   </div>
			   </div>
			  <?php  if($count%2==0)
       				{?>
		   </div>
		   <?php }?>
			<?php 
       			$count++;
       			}
       		}
			?>
		</div>
		</div>
		</div>
  	<?php }
}
?> 